package com.anyikang.volunteer.sos.volunteer.app.sos;

import java.util.ArrayList;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;


public class MyFragmentPagerAdapter extends FragmentPagerAdapter {
    private ArrayList<Fragment> fragmentsList;

    public MyFragmentPagerAdapter(FragmentManager fm) {
        super(fm);
    }



    public MyFragmentPagerAdapter(FragmentManager fm, ArrayList<Fragment> fragments) {
        super(fm);
        this.fragmentsList = fragments;
    }



    @Override
    public int getCount() {
        return 4;
    }

    @Override
    public Fragment getItem(int pageIndex) {

        Fragment  fragment = null;
        switch (pageIndex)
        {
            case 0:
                fragment =  HelpAllStateFragment.newInstance("123");
                break;
            case 1:
                fragment =  HelpNeedFragment.newInstance("123");
                break;
            case 2:
                fragment =  HelpingFragment.newInstance("123");
                break;
            case 3:
                fragment =  HelpCompleteFragment.newInstance("123");
                break;
        }
        return fragment;


    }

    @Override
    public int getItemPosition(Object object) {
        return super.getItemPosition(object);
    }

}
